package com.tencent.feign;

import com.tencent.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OrderFallBack implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        return new UserService() {
            @Override
            public User findUserById(Long id) {
                return new User(-1L, "熔断了", "服务出错了");
            }
        };
    }
}
